package dao;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import java.util.ResourceBundle;

public class Dao {
	protected static Connection con;
	protected static Properties config;
	public Dao(){	
		try{
			FileInputStream inConfig = new FileInputStream("src/config.properties");	
			config = new Properties();
			config.load(inConfig);
			inConfig.close();
			//ResourceBundle bundle = ResourceBundle.getBundle("config");
			DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
			con = DriverManager.getConnection (config.getProperty("url"), config.getProperty("user"), config.getProperty("password"));
			
		} 
			catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
		} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
